n = int(input())
# 第i天结束后剩下j个苹果的情况总数为dp[i][j]
dp = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
dp[0][n] = 1
for i in range(1, n + 1):
    for j in range(n + 1):
        if j <= 0:
            if j + 3 <= n:
                dp[i][j] += dp[i - 1][j + 3]
            if j + 2 <= n:
                dp[i][j] += 2 * dp[i - 1][j + 2]
            if j + 1 <= n:
                dp[i][j] += dp[i - 1][j + 1]
        else:
            if j + 3 <= n:
                dp[i][j] += dp[i - 1][j + 3]
            if j + 2 <= n:
                dp[i][j] += dp[i - 1][j + 2]
cnt = 0
for i in range(1, n + 1):
    cnt += dp[i][0]
print(cnt)
